package com.ruoyi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum UserResourceEnum {
    BACK_MANAGEMENT_SYSTEM("1", "后台管理系统"),
    USER_APPOINTMENT_SYSTEM("2", "用户预约系统"),
    ;

    private final String code;
    private final String info;

    public static String getInfoByCode(String code) {
        for (UserResourceEnum tradeWaterTypeEnum : UserResourceEnum.values()) {
            if (tradeWaterTypeEnum.getCode().equals(code)) {
                return tradeWaterTypeEnum.getInfo();
            }
        }
        return null;
    }

    public static UserResourceEnum getByCode(String code) {
        for (UserResourceEnum tradeWaterTypeEnum : UserResourceEnum.values()) {
            if (tradeWaterTypeEnum.getCode().equals(code)) {
                return tradeWaterTypeEnum;
            }
        }
        return null;
    }
}
